﻿using System;
using System.Linq;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.IO.IsolatedStorage;
using System.Runtime.Serialization;

namespace SBPweb.RIA.Client.Contracts.Base
{

#if !WINDOWS_PHONE

    [CollectionDataContract]
    public class ApplicationSettings : LocalStoreBase<ApplicationSettings, ApplicationSettingsFormatter>
    {

        #region Constructor logic

        static ApplicationSettings()
        {
            FileName = "ApplicationSettings.xml";
            Scope = StorageScopes.Application;
        }

        public ApplicationSettings()
            : base()
        {
        }

        public ApplicationSettings(IEnumerable<KeyValuePair<string, object>> keyValues)
            : base(keyValues)
        {
        }

        #endregion
        
    }

    public class ApplicationSettingsFormatter : LocalStoreFormatterBase
    {

        public override IsolatedStorageFileStream DecodeIsoStream(IsolatedStorageFileStream isoStream)
        {
            return isoStream;
        }

        public override IsolatedStorageFileStream EncodeIsoStream(IsolatedStorageFileStream isoStream)
        {
            return isoStream;
        }

    }

#endif

}